﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Common;
using Domain.Common;
using Microsoft.Xna.Framework;

namespace UIComponentSprite.Date
{
    /// <summary>
    /// 历史日期显示
    /// </summary>
    public class DateSprite : ImageTextSprite
    {
        public DateSprite()
        {
            DrawPosition.X = 150;
            DrawPosition.Y = 15;
            DrawPosition.Width = 150;
            DrawPosition.Height = 20;
            this.Showing = true;
        }
        public override void Update(GameTime gameTime)
        {
            if (!Showing)
                return;
            LoadPic();
        }

        protected override void LoadPic()
        {
            string temp = HistoryDate.GetFormatDate();
            if (this.Text != temp)
            {
                this.Text = temp;
                this.Image = CreateTextTexture(temp);
            }
        }
    }
}
